#include <iostream>

using namespace std;
const int N =65;
int arr[N];
int n;

int main()
{
	while(1)
	{
		cin>>n;
		if(n==0)
			break;
		int max = 0;
		for(int i=0;i<n;i++)
			{
				cin>>arr[i];
				if(arr[i]>max)
					max=arr[i];
			}
		cout<<max+1<<endl;
		
	}
	return 0;
}
